import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n
import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
import '@/styles/index.scss' // global css
// import './utils/ant-design-vue'
import App from './App'
import router from './router/routers'
import permission from './components/Permission'
import onlyNumber from "./components/OnlyNumber";
import dict from './components/Dict'
import store from './store'
import VCharts from 'v-charts'
import '@/icons' // icon
import './router/index' // permission control
import Router from 'vue-router'
import Print from 'vue-print-nb'
import Viewer from 'v-viewer'
import 'viewerjs/dist/viewer.css'
import {currency} from './utils/currency'
import antdv from '@/utils/ant-design-vue'
import Copy from 'v-copy'
Vue.use(Copy)
Vue.filter("currency", currency)

Vue.use(Viewer);
Viewer.setDefaults({
  Options: {
    "inline": true,
    "button": true,
    "navbar": true,
    "title": true,
    "toolbar": true,
    "tooltip": true,
    "movable": true,
    "zoomable": true,
    "rotatable": true,
    "scalable": true,
    "transition": true,
    "fullscreen": true,
    "keyboard": true,
    "url": "data-source"
  }
});
Vue.use(onlyNumber)
Vue.use(Print);  //注册
Vue.use(mavonEditor)
Vue.use(permission)
Vue.use(dict)
Vue.use(ElementUI, {locale})
Vue.config.productionTip = false
Vue.use(VCharts)
const routerPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return routerPush.call(this, location).catch(error => error)
}
require('babel-polyfill')

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
